package com.xx.hiconsume.controller;

import com.xx.hiconsume.service.HelloFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class HelloController {

    @Resource
    private RestTemplate restTemplateRpc;

    @Resource
    private HelloFeignService helloFeignService;

    @GetMapping("/hi")
    public String getHi() {
        return restTemplateRpc.getForObject("http://HELLO/hi", String.class);
    }

    @GetMapping("/feignHi")
    public String feignhi() {
        return helloFeignService.hi();
    }
}
